package com.wzcl.app.model.vo;

import com.wzcl.app.dao.model.RefundRequest;
import com.wzcl.app.model.common.WZCL;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;
import java.util.Map;

@Data
public class RefundRequestVo extends BaseVo {

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "退款原因")
    private String reason;

    @ApiModelProperty(value = "审核状态")
    private Integer auditState;
    private String auditStateStr;

    @ApiModelProperty(value = "返回消息")
    private String message;

    @ApiModelProperty(value = "退款发起时间")
    private Date createTime;

    @ApiModelProperty(value = "订单创建时间")
    private Date orderCreateTime;

    @ApiModelProperty(value = "用户手机号")
    private String userPhone;



    public RefundRequestVo() {
    }

    public static RefundRequestVo create(RefundRequest refundRequest){
        RefundRequestVo refundRequestVo = new RefundRequestVo();
        BeanUtils.copyProperties(refundRequest,refundRequestVo);
        refundRequestVo.translationValueStr();
        return refundRequestVo;
    }

    @Override
    public void translationValueStr() {
        Map<String, Map<Integer, String>> map = getTranslationMap();
        this.auditStateStr = map.get(WZCL.GROUP_NAME.AUDIT_STATE).get(this.auditState);
    }

    @Override
    public void processResources() {

    }
}
